getApp(), Page({
    data: {
        list: [ "真心话", "唱歌跳舞", "30个俯卧撑", "告白", "表情帝", "撒娇", "喝一杯", "喝半杯", "下家喝", "上家喝", "指定一家喝", "没事" ]
    },
    onLoad: function() {},
    setDefault: function() {
        var t = this;
        wx.showModal({
            title: "提示",
            content: "恢复默认后，所有修改将被清除",
            success: function(a) {
                if (a.confirm) {
                    var s = wx.getStorageSync("zhuanpanlistDefault");
                    s && t.setData({
                        list: s
                    }), wx.setStorageSync("zhuanpanlist", t.data.list);
                }
            }
        });
    },
    onShow: function() {
        var t = wx.getStorageSync("zhuanpanlist");
        t && this.setData({
            list: t
        });
    },
    remove: function(t) {
        if (this.data.list.length <= 4) return wx.showModal({
            title: "提示",
            content: "最少不能低于4项",
            showCancel: !1
        });
        var a = t.currentTarget.dataset.index, s = this.data.list;
        s.splice(a, 1), this.setData({
            list: s
        }), wx.setStorageSync("zhuanpanlist", this.data.list);
    },
    add: function() {
        if (this.data.list.length >= 20) return wx.showModal({
            title: "提示",
            content: "最多不能超过20项",
            showCancel: !1
        });
        var t = this.data.list;
        t.push(""), this.setData({
            list: t
        }), wx.setStorageSync("zhuanpanlist", this.data.list);
    },
    textInput: function(t) {
        var a = this.data.list;
        a[t.currentTarget.dataset.index] = t.detail.value, this.setData({
            list: a
        }), wx.setStorageSync("zhuanpanlist", this.data.list);
    }
});